/* 
以abstract开头的类是抽象类
  抽象类不能创建对象，只能用来被继承

抽象方法没有方法体，子类必须对抽象法进行重写
*/
abstract class Person {
  name: string
  constructor(name: string) {
    this.name = name
  }
  // 抽象方法
  abstract sayhai(): void
}

class Student extends Person {
  age: number
  constructor(name: string, age: number) {
    super(name)
    this.age = age
  }
  sayhai(): void {
    console.log(this.name)
  }
  sing(): void {
    console.log("唱歌")
  }
}

let s: Student = new Student("刘德华", 17)
s.sayhai()
s.sing()

export { }